export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  app: {
    head: {
      title: "AI-解析视频",
      htmlAttrs: {
        lang: "cn",
      },
      meta: [
        { charset: "utf-8" },
        {
          name: "viewport",
          content: "width=device-width, initial-scale=1.0, user-scalable=no",
        },
        {
          hid: "description",
          name: "description",
          content: "解析视频",
        },
        { name: "format-detection", content: "telephone=no" },
      ],
      link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
      // script: [
      //   {
      //     src: "https://hm.baidu.com/hm.js?d984dbbc8e8609739dd498fe81c1095c",
      //   },
      // ],
    },
  },

  runtimeConfig: {
    // 默认配置 (服务端和客户端共享)
    public: {
      baseURL:
        process.env.NODE_ENV === "production"
          ? "/travel"
          : "http://127.0.0.1:8080",
    },
    // 只在服务端使用的配置 (敏感信息放在这里)
    apiSecret: process.env.API_SECRET || "defaultSecretKey",
    serverURL:
      process.env.NODE_ENV === "production"
        ? "/travel"
        : "http://127.0.0.1:8080",
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: ["assets/scss/index.scss"],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: ["@/plugins/ElementPlusIcons", "@/plugins/Service"],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  store: "@/store/index",

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: ["@element-plus/nuxt", "@pinia/nuxt"],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    transpile: ["@popperjs/core"],
  },

  ssr: true,

  target: "server",

  compatibilityDate: "2024-08-10",
};
